﻿using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace BF3StatsNetApi.BLL
{
    public class Level
    {
        public string name { get; set; }
        public string img { get; set; }
        private List<Difficulty> _difficulty;
        public object difficulty { 
            get { return _difficulty; } 
            set {
                _difficulty = new List<Difficulty>();
                foreach (KeyValuePair<string, JToken> gm in (JObject)value)
                {
                    Difficulty _diff = JsonConvert.DeserializeObject<Difficulty>(gm.Value.ToString());
                    _difficulty.Add(_diff);
                }
            } 
        }

    }
}
